package com.lintf.web.controller.bot;

import com.lintf.bot.domain.dto.BotConsumptionAddDTO;
import com.lintf.bot.domain.dto.BotConsumptionListDTO;
import com.lintf.bot.domain.dto.BotConsumptionRemoveDTO;
import com.lintf.bot.domain.dto.BotConsumptionUpdateDTO;
import com.lintf.bot.service.IBotConsumptionService;
import com.lintf.common.core.controller.BaseController;
import com.lintf.common.core.domain.AjaxResult;
import com.lintf.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ system:Mac
 * @ author:lin tingfeng
 * @ data:2024/1/9 15:59
 * @ package_name:com.lintf.web.controller.bot
 * @ project_name:mobile-project
 * @ desc:
 */
@RestController
@RequestMapping("/bot/consumption")
public class BotConsumptionController extends BaseController {

    @Autowired
    private IBotConsumptionService botConsumptionService;

    @GetMapping("/list")
    public TableDataInfo list(BotConsumptionListDTO dto) {
        return getDataTable(botConsumptionService.list(dto));
    }

    @PostMapping("/add")
    public AjaxResult add(@RequestBody BotConsumptionAddDTO dto) {
        return AjaxResult.success(botConsumptionService.add(dto));
    }

    @PostMapping("/update")
    public AjaxResult update(@RequestBody BotConsumptionUpdateDTO dto){
        return AjaxResult.success(botConsumptionService.update(dto));
    }

    @PostMapping("/remove")
    public AjaxResult remove(@RequestBody BotConsumptionRemoveDTO dto) {
        return AjaxResult.success(botConsumptionService.remove(dto));
    }

}
